package com.junzhiit.nengji.cms.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junzhiit.nengji.bo.UserBO;
import com.junzhiit.nengji.cms.service.MyContactsService;
import com.junzhiit.nengji.cms.web.util.ViewObjectUtil;
import com.junzhiit.nengji.cms.web.vo.DataTablesParamVO;
import com.junzhiit.nengji.cms.web.vo.UserVO;
import com.junzhiit.nengji.dao.UserDAO;

@Service
public class MyContactsServiceImpl extends BaseServiceImpl implements MyContactsService {

	@Autowired
	UserDAO userDAO;

	@Override
	public Map<String,Object> queryUserList(DataTablesParamVO dtp,UserVO userVO) {
		UserBO userBO = new UserBO();
		BeanUtils.copyProperties(userVO, userBO);
		List<UserBO> userBOList=userDAO.queryUserList(userBO,dtp.getStart(),dtp.getLength());
		Integer getUserCount=userDAO.getUserCount(userBO);
		return ViewObjectUtil.dataTables(userBOList, dtp.getDraw(), getUserCount);
	}
}
